package com.gerry.demo;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.demo.user.xml.service.UserService;

public class TestStudent1 {
	public static void main(String[] args) {
		/*// 创建Stduent对象
		Student stu = new Student();*/
		
		// Spring容器实例化
		ApplicationContext ctx = new ClassPathXmlApplicationContext("container-dev.xml");
		// 获取service实例
		
		// 构造函数
		UserService userService = (UserService) ctx.getBean("userService");
		userService.saveUser();
		//////////////////////////////// property
		UserService userService1 = (UserService) ctx.getBean("userService1");
		userService1.saveUser();
	}
}
